﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

using ZMenFM.Utils.Img;

namespace ZMenFM.Utils.UI
{
    /// <summary>
    /// ZMWindowShadowEx.xaml 的交互逻辑
    /// </summary>
    public partial class ZMWindowShadowEx : UserControl
    {
        private Window Parent;

        protected static bool ResourceLoaded = false;
        protected static ImageSource ActiveTopLeftImage;
        protected static ImageSource ActiveTopImage;
        protected static ImageSource ActiveTopRightImage;
        protected static ImageSource ActiveLeftImage;
        protected static ImageSource ActiveRightImage;
        protected static ImageSource ActiveBottomLeftImage;
        protected static ImageSource ActiveBottomImage;
        protected static ImageSource ActiveBottomRightImage;

        protected static ImageSource InactiveTopLeftImage;
        protected static ImageSource InactiveTopImage;
        protected static ImageSource InactiveTopRightImage;
        protected static ImageSource InactiveLeftImage;
        protected static ImageSource InactiveRightImage;
        protected static ImageSource InactiveBottomLeftImage;
        protected static ImageSource InactiveBottomImage;
        protected static ImageSource InactiveBottomRightImage;

        /// <summary>
        /// 加载阴影图片文件
        /// </summary>
        static public void LoadShadowImage()
        {
            ResourceLoaded = true;

            ActiveTopLeftImage = new BitmapImage(ZMUtilsImgLoader.GetImageUri("Shadow/ACTIVESHADOWTOPLEFT.png"));
            ActiveTopImage = new BitmapImage(ZMUtilsImgLoader.GetImageUri("Shadow/ACTIVESHADOWTOP.png"));
            ActiveTopRightImage = new BitmapImage(ZMUtilsImgLoader.GetImageUri("Shadow/ACTIVESHADOWTOPRIGHT.png"));
            ActiveLeftImage = new BitmapImage(ZMUtilsImgLoader.GetImageUri("Shadow/ACTIVESHADOWLEFT.png"));
            ActiveRightImage = new BitmapImage(ZMUtilsImgLoader.GetImageUri("Shadow/ACTIVESHADOWRIGHT.png"));
            ActiveBottomLeftImage = new BitmapImage(ZMUtilsImgLoader.GetImageUri("Shadow/ACTIVESHADOWBOTTOMLEFT.png"));
            ActiveBottomImage = new BitmapImage(ZMUtilsImgLoader.GetImageUri("Shadow/ACTIVESHADOWBOTTOM.png"));
            ActiveBottomRightImage = new BitmapImage(ZMUtilsImgLoader.GetImageUri("Shadow/ACTIVESHADOWBOTTOMRIGHT.png"));

            InactiveTopLeftImage = new BitmapImage(ZMUtilsImgLoader.GetImageUri("Shadow/INACTIVESHADOWTOPLEFT.png"));
            InactiveTopImage = new BitmapImage(ZMUtilsImgLoader.GetImageUri("Shadow/INACTIVESHADOWTOP.png"));
            InactiveTopRightImage = new BitmapImage(ZMUtilsImgLoader.GetImageUri("Shadow/INACTIVESHADOWTOPRIGHT.png"));
            InactiveLeftImage = new BitmapImage(ZMUtilsImgLoader.GetImageUri("Shadow/INACTIVESHADOWLEFT.png"));
            InactiveRightImage = new BitmapImage(ZMUtilsImgLoader.GetImageUri("Shadow/INACTIVESHADOWRIGHT.png"));
            InactiveBottomLeftImage = new BitmapImage(ZMUtilsImgLoader.GetImageUri("Shadow/INACTIVESHADOWBOTTOMLEFT.png"));
            InactiveBottomImage = new BitmapImage(ZMUtilsImgLoader.GetImageUri("Shadow/INACTIVESHADOWBOTTOM.png"));
            InactiveBottomRightImage = new BitmapImage(ZMUtilsImgLoader.GetImageUri("Shadow/INACTIVESHADOWBOTTOMRIGHT.png"));
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="p">父窗口</param>
        public ZMWindowShadowEx(Window p)
        {
            InitializeComponent();
            if (!ResourceLoaded) LoadShadowImage();

            Parent = p;
        }

        public void SetActive()
        {

        }
    }
}
